package models

import (
	"gorm.io/gorm"
	"time"
)

type Comment struct {
	ID         int64     `gorm:"primaryKey;autoIncrement;comment:主键"`
	UserID     int64     `gorm:"not null;default:0;index:fk_user_comment;comment:评论作者id"`
	VideoID    int64     `gorm:"not null;default:0;index:fk_video_comment;comment:评论视频id"`
	Contents   string    `gorm:"type:varchar(255);not null;default:'';comment:评论内容"`
	CreateTime int64     `gorm:"not null;default:0;comment:自设创建时间(unix)"`
	CreatedAt  time.Time `gorm:"comment:创建时间"`
	UpdatedAt  time.Time `gorm:"autoUpdateTime;comment:更新时间"`
	DeletedAt  gorm.DeletedAt
}

func (Comment) TableName() string {
	return "comment"
}
